<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSpidersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('spiders', function (Blueprint $table) {
            $table->increments('spider_id')->comment('主键');
            $table->string('name', 20)->comment('爬虫名称')->unique();
            $table->string('url', 50)->comment('爬取地址')->unique();
            $table->string('list', 255)->comment('列表正则');
            $table->string('content', 255)->comment('内容正则');
            $table->integer('status')->comment('爬虫状态')->default(0);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('spiders');
    }
}
